<ul id="comments" data-page="1" data-id="0">
    <#list page.content as c>
        <div class="_j_commentlist">
            <div class="rev-list">
                <ul>
                    <li class="rev-item comment-item clearfix">
                        <div class="user"><a class="avatar" href="/u/52068941.html" target="_blank"><img
                                        src="${c.headUrl!}"
                                        width="48" height="48"></a><span class="level">LV.${c.level!1}</span></div>
                        <#--<a class="useful " data-id="191407415" title="点赞">
                            <i></i><span class="useful-num">${c.thumbupnum!0}</span>
                        </a>-->
                        <#if userInfo??>
                            <a href="javascript:;" class="btn-comment-like _j_like_comment_btn
                     ${c.thumbuplist?seq_contains(userInfo.id)?string("liked", "like")}
                " data-toid="${c.id}" data-fromid="${(userInfo.id)!-1}">
                                <span class="_j_comment_like_num">${c.thumbupnum!}</span>
                            </a>
                        </#if>
                        <a class="name" href="/u/52068941.html" target="_blank">${c.username!}</a>
                        <span class="s-star s-star${c.rank_star!}"></span>
                        <p class="rev-txt">${c.content!}
                        </p>


                        <div class="rev-img">
                            <a href="/photo/poi/25091_440424016.html" target="_blank"><img
                                        src="${c.tupianUrl!}"
                                        width="200" height="120"></a>
                        </div>

                        <div class="info clearfix">
                            <span class="time">${c.createTime?string('yyyy-MM-dd HH:ss')}</span>
                        </div>


                        <div class="comment add-reply ">
                            <#list (c.thumbuplist)! as reply>
                                <ul class="more_reply_box comment_list">

                                    <li>
                                        <a href="/u/63107989.html" target="_blank">
                                            <img src="${reply.headUrl}"
                                                 width="16" height="16">${reply.username}
                                        </a>
                                        ：${reply.content}
                                        <a class="_j_reply re_reply" data-id="625204" data-uid="63107989"
                                           data-username="🍓辣辣辣辣王🍓" title="添加回复">回复</a>
                                        <br><span class="time">${reply.createTime?string('yyyy-MM-dd HH:ss')}</span>
                                    </li>
                                </ul>
                            </#list>

                            <div class="add-comment hide reply-form">
                                    <textarea id="reply" class="comment_reply"
                                              style="overflow: hidden; color: rgb(204, 204, 204);"></textarea>
                                <button class="btn btn_submit_reply" data-id="${c.id}"
                                        data-attractionsId="${c.attractionsId}">回复
                                </button>
                            </div>
                        </div>


                    </li>
                </ul>
            </div>
        </div>
    </#list>
    <div style="float: right">
        <div style="float: left;"><span style="line-height:30px"> 共${page.totalPages!}页 / ${page.totalElements}条&nbsp;&nbsp;&nbsp;</span>
        </div>
        <div id="pagination" class="jq-pagination" style="display: inline;"></div>
    </div>
    <script>
        $("#pagination").jqPaginator({
            totalPages: ${page.totalPages!0},
            visiblePages: 5,
            currentPage: ${page.number+1} || 1,
            prev
        :
        '<a class="prev" href="javascript:void(0);">上一页<\/a>',
            next
        :
        '<a class="next" href="javascript:void(0);">下一页<\/a>',
            page
        :
        '<a href="javascript:void(0);">{{page}}<\/a>',
            last
        :
        '<a class="last" href="javascript:void(0);" >尾页<\/a>',
            onPageChange
        :

        function (page, type) {
            if (type == 'change') {
                $("#currentPage").val(page);
                $("#searchForm").submit();
            }

        }
        })
    </script>
    <script>
        $('.info').on("mouseout", function () {
            $(this).find(".rep-del").css("display", "none");
        }).on("mouseover", function () {
            $(this).find(".rep-del").css("display", "block");
        });

        //点赞
        $("._j_like_comment_btn").click(function () {
            var _this = $(this);

            var toid = $(this).data("toid");
            var fromid = $(this).data("fromid");
            $.get("/attractions/commentThumbUp", {toid: toid, fromid: fromid}, function (data) {

                $("#currentPage").val(1);

                window.location.reload();
            })
        })
    </script>
    <script>
        $(function () {
            $(".btn_submit_reply").click(function () {

                var content = $("#reply").val();
                console.log(content);
                var id = $(this).data("id");
                var attractionsId = $(this).data("attractionsId");
                console.log(attractionsId);

                $.post("/attractions/replayAdd", {
                    id: id,
                    attractionsId: attractionsId,
                    content: content
                }, function (data) {

                    $(".replay_num").html(data.data);

                    $("#currentPage").val(1);

                    window.location.reload();

                });
            })


        })
    </script>
</ul>
